package com.tjufe;

public class SilverCard extends Card{
    public SilverCard() {
    }


    public SilverCard(String carId, String name, String phone, double money) {
        super(carId, name, phone, money);
    }

    @Override
    public void consume(double money) {
        System.out.println("你当前消费："+money);
        System.out.println("优惠后的价格："+money*0.9);
        if (getMoney()<0){
            System.out.println("您余额是："+getMoney()+",当前余额不足，请存钱");
            return;//跳出当前方法
        }
        //更新银卡的账户余额
        setMoney(getMoney()-money*0.9);
    }
}
